const name = require('./project').name;
const projectName = process.argv[2] || name;

console.log('\033[42;30m WEB LOG \033[40;37m 正在运行编译的项目是 ' + projectName + '\033[0m\n')

let fs = require('fs');

// 记录正在运行的项目名
fs.writeFileSync('./config/project.js', `exports.name = '${projectName}'`)

// 启动一个新的进程，并执行命令
let exec = require('child_process').execSync;
exec('npm run serve', {stdio: 'inherit'});